home *** CD-ROM | disk | FTP | other *** search
- * curtain.s
- * カーテン / 最高速 = 2
- * by Mitsuky
-
- .include DOSCALL.MAC
-
- SPEED_MAX equ 2
-
- .offset 8 * 引き数
- _source_ptr: .ds.l 1
- _dest_ptr: .ds.l 1
- _speed: .ds.l 1
- _vdisp: .ds.l 1
-
-
- .offset 0
- gvram_ptr: .ds.l 1
- counter: .ds.w 1
- work_size:
-
-
- gpos .macro pos_x,pos_y
- .dc.w (pos_y*1024)+(pos_x*2)
- .endm
-
-
- .text
- .even
-
- .dc.b 'WL10',$0d,$0a
- .dc.b 'カーテン / 最高速 = 2',$0d,$0a
- .dc.b ' by Mitsuky',$0d,$0a
- .dc.b $1a
- .even
-
- curtain:
- link a6,#0
- movem.l d1-d7/a0-a5,-(sp)
-
- suba.l a5,a5
-
- move.l _speed(a6),d0
- bmi curtain_ask_speed
- cmpi.l #SPEED_MAX,d0
- bhi curtain_err
-
- tst.l _vdisp(a6)
- bmi curtain_ask_vdisp
-
-
- move.l #work_size*(512/16)*(512/16),-(sp)
- DOS _MALLOC
- addq.w #4,sp
- tst.l d0
- bmi curtain_err
- movea.l d0,a5 * a5.l = ワークのアドレス
-
-
- movea.l _source_ptr(a6),a2 * a2.l = 転送元アドレス
- movea.l _dest_ptr(a6),a3 * a3.l = 転送先アドレス
- lea.l table2(pc),a1 * a1.l = table2 のポインタ
-
- * ワークの初期化
- movea.l a5,a0
- move.w #(512/16)*(512/16)-1,d0
- moveq.l #-1,d1
- @@: move.w d1,counter(a0)
- lea.l work_size(a0),a0
- dbra d0,@b
-
-
- lea.l appear(pc),a0
- clr.w (a0) * 出現カウンター
- curtain_loop:
- moveq.l #SPEED_MAX,d1
- sub.l _speed(a6),d1
- @@: move.l _vdisp(a6),a0
- jsr (a0)
- dbra d1,@b
-
- sf.b d5
-
-
- * ワークを出現させる
- 1:
- lea.l appear(pc),a0
- subq.w #1,(a0)
- bpl 5f
- move.l (a1)+,d0
- bmi 4f
-
- movea.l a5,a4 * a4.l = ワークのアドレス
- 2: tst.w counter(a4)
- bmi 3f
- lea.l work_size(a4),a4
- bra 2b
- 3: move.l d0,d1
- andi.l #$00ffffff,d1
- move.l d1,gvram_ptr(a4)
- clr.w counter(a4)
- rol.l #8,d0
- andi.w #$00ff,d0
- movea.l a5,a4
- lea.l appear(pc),a0
- move.w d0,(a0)
- bra 1b
- 4:
- lea.l appear(pc),a0
- move.w #32767,(a0)
- 5:
-
- movem.l a1,-(sp) **
-
-
- move.w #(512/16)*(512/16)-1,d7 * d7.w = ループ回数
- movea.l a5,a4
- curtain_loop_2:
- tst.w counter(a4)
- bmi curtain_loop_2_end
-
-
- st.b d5
-
- moveq.l #4-1,d6
- @@:
- movea.w counter(a4),a1
- move.w a1,d0
- addq.w #1,d0
- move.w d0,counter(a4)
- add.w a1,a1
- movea.w table(pc,a1.w),a1
- adda.l gvram_ptr(a4),a1
-
- movea.l a2,a0
- adda.l a1,a0
- move.w (a0),d1
- move.w 8*2(a0),d2
- move.w 8*512*2(a0),d3
- move.w 8*512*2+8*2(a0),d4
-
- movea.l a3,a0
- adda.l a1,a0
- move.w d1,(a0)
- move.w d2,8*2(a0)
- move.w d3,8*512*2(a0)
- move.w d4,8*512*2+8*2(a0)
-
- dbra d6,@b
-
-
- move.w counter(a4),d0
- cmpi.w #64,d0
- bcs @f
- move.w #-1,counter(a4)
- @@:
-
- curtain_loop_2_end:
- lea.l work_size(a4),a4
- dbra d7,curtain_loop_2
-
- movem.l (sp)+,a1 **
-
- tst.b d5
- bne curtain_loop
-
- moveq.l #0,d0
- curtain_rts:
- move.l a5,d1
- beq @f
- movem.l d0,-(sp)
- pea.l (a5)
- DOS _MFREE
- addq.w #4,sp
- movem.l (sp)+,d0
- @@:
- movem.l (sp)+,d1-d7/a0-a5
- unlk a6
- rts
-
-
- *********************************************************
- table:
- gpos 0,0
- gpos 4,4
- gpos 2,6
- gpos 5,1
- gpos 7,3
- gpos 2,2
- gpos 6,6
- gpos 3,7
- gpos 7,1
- gpos 0,4
- gpos 7,7
- gpos 4,2
- gpos 1,5
- gpos 6,0
- gpos 3,3
- gpos 5,7
- gpos 6,2
- gpos 2,0
- gpos 3,5
- gpos 6,4
- gpos 3,1
- gpos 7,5
- gpos 1,3
- gpos 4,6
- gpos 5,3
- gpos 4,0
- gpos 0,2
- gpos 1,7
- gpos 5,5
- gpos 1,1
- gpos 0,6
- gpos 2,4
-
-
- gpos 1,0
- gpos 5,4
- gpos 3,6
- gpos 6,1
- gpos 0,3
- gpos 3,2
- gpos 7,6
- gpos 4,7
- gpos 0,1
- gpos 1,4
- gpos 0,7
- gpos 5,2
- gpos 2,5
- gpos 7,0
- gpos 4,3
- gpos 6,7
- gpos 7,2
- gpos 3,0
- gpos 4,5
- gpos 7,4
- gpos 4,1
- gpos 0,5
- gpos 2,3
- gpos 5,6
- gpos 6,3
- gpos 5,0
- gpos 1,2
- gpos 2,7
- gpos 6,5
- gpos 2,1
- gpos 1,6
- gpos 3,4
-
-
- * 0 1 2 3 4 5 6 7
- * 00..17..25..13.. 0
- * ..29..20..03..08 1
- * 26..05..11..16.. 2
- * ..22..14..24..04 3
- * 09..31..01..19.. 4
- * ..12..18..28..21 5
- * 30..02..23..06.. 6
- * ..27..07..15..10 7
-
- * 0 1 2 3 4 5 6 7
- * ..00..17..25..13 0
- * 08..29..20..03.. 1
- * ..26..05..11..16 2
- * 04..22..14..24.. 3
- * ..09..31..01..19 4
- * 21..12..18..28.. 5
- * ..30..02..23..06 6
- * 10..27..07..15.. 7
-
- **** ****
- .even
- curtain_err:
- moveq.l #-1,d0
- bra curtain_rts
-
-
- **** ****
- curtain_ask_speed:
- moveq.l #SPEED_MAX,d0
- bra curtain_rts
-
-
- **** ****
- curtain_ask_vdisp:
- move.l _speed(a6),d0
- lea.l ask_vdisp_table(pc),a0
- add.w d0,d0
- move.w (a0,d0.w),d0
- bra curtain_rts
-
- ask_vdisp_table:
- .dc.w 144,96,48
-
-
- table2: *次を待つ回数(垂直同期単位)<<24|Y座標<<10|X座標<<1
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|0<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|0<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|1<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|1<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|2<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|2<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|3<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|3<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|4<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|4<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|5<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|5<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|6<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|6<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|7<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|7<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|8<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|8<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|9<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|9<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|10<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|10<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|11<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|11<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|12<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|12<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|13<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|13<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|14<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|14<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|15<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|15<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|16<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|16<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|17<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|17<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|18<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|18<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|19<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|19<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|20<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|20<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|21<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|21<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|22<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|22<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|23<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|23<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|24<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|24<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|25<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|25<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|26<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|26<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|27<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|27<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|28<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|28<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|29<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|29<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|30<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|30<<4<<1
-
- .irp %A,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30
- .dc.l 0<<24|%A<<4<<10|31<<4<<1
- .endm
- .dc.l 1<<24|31<<4<<10|31<<4<<1
-
-
- .dc.l 32767<<24 * 終端フラグ
-
-
- appear:
- .ds.w 1
-